package org.vizzini.xwingminiatures;

import java.util.ArrayList;
import java.util.List;

import org.vizzini.core.game.DefaultGame;
import org.vizzini.core.game.Game;
import org.vizzini.core.game.GameInjector;
import org.vizzini.core.game.Team;

/**
 * Provides a game injector for X-Wing Miniatures.
 */
public final class XWingGameInjector implements GameInjector
{
    @Override
    public XWingAdjudicator injectAdjudicator()
    {
        return new XWingAdjudicator();
    }

    /**
     * @return a new damage deck.
     */
    public List<DamageCard> injectDamageDeck()
    {
        return DamageCard.createDeck();
    }

    @Override
    public XWingEngine injectEngine()
    {
        return new XWingEngine();
    }

    @Override
    public XWingEnvironment injectEnvironment()
    {
        return new XWingEnvironment(injectDamageDeck());
    }

    @Override
    public Game injectGame()
    {
        return new DefaultGame(injectName(), injectDescription(), injectEngine(), injectEnvironment(),
                injectAdjudicator(), injectTeams());
    }

    @Override
    public List<Team> injectTeams()
    {
        final List<Team> answer = new ArrayList<Team>();

        answer.add(XWingTeam.IMPERIAL);
        answer.add(XWingTeam.REBEL);

        return answer;
    }

    /**
     * @return description
     */
    private String injectDescription()
    {
        return "An X-Wing Miniatures game.";
    }

    /**
     * @return name
     */
    private String injectName()
    {
        return "X-Wing";
    }
}
